package com.spundhan.xtrac;

import android.app.ActionBar;
import android.app.Activity;
import android.view.MenuItem;
import android.view.View;

import com.aretha.slidemenu.SlideMenu;

public class MainActivity extends SlidiningMenuActivity{
	
	private ActionBar actionBar;
	
	private static SlideMenu mSlideMenu;
	
	public static Activity activity;
	
	
	@Override
	public void onContentChanged() {
		super.onContentChanged();
		setSlideRole(R.layout.activity_summary);
		setSlideRole(R.layout.activity_side_menu);
		
		getActionBar().setHomeButtonEnabled(true);
		
		activity = this;
		
		actionBar = getActionBar();
		
		mSlideMenu = getSlideMenu();
		
		mSlideMenu.setSlideMode(SlideMenu.MODE_SLIDE_WINDOW);
		
		actionBar.setTitle("");
		
	}
	
	public void open(View v) {

		mSlideMenu.open(false, true);
	}
	
	public static void close(){
		
		mSlideMenu.close(true);
		
	}
	
	@Override
	public boolean onMenuItemSelected(int featureId, MenuItem item) {

		int itemId = item.getItemId();
		switch (itemId) {
		case android.R.id.home:
			mSlideMenu.open(false, true);
			break;
		
		}
		return true;
	}
	
}
